<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="/resources/images/favicon.ico"
	type="image/x-icon">
<link rel="icon" href="/resources/images/favicon.ico"
	type="image/x-icon">
<script src="/resources/js/jquery.1.9.1.min.js"></script>
<script src="/resources/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/resources/js/scrollpagination.js"></script>
<script type="text/javascript" src="/resources/js/photoFunction.js"></script>
<script type="text/javascript" src="/resources/js/adminFunction.js"></script>
<title>Trollvl - Cộng đồng chế ảnh</title>
<script>
	$(function() {
		load_photo();
		gif_hover();
	});
</script>
</head>
<body>
	<tiles:insertDefinition name="defaultTemplate">
		<tiles:putAttribute name="body">
			<div id="mainContainer">
				<div id="mainBox" class="mainBox">
					<div class="subHeading">
						<h3>Ảnh Mới</h3>

					</div>
					<div id="trollsContent" class="newsList">
						<c:forEach items="${trollList}" var="trollItem">
							<div class="newsListItem">
								<div class="listItemSeparator"></div>
								<c:choose>
									<c:when test="${trollItem.url.lastIndexOf('.gif') != -1}">
										<div class="trollThumbnail hide">
									</c:when>
									<c:otherwise>
										<div class="trollThumbnail">
									</c:otherwise>
								</c:choose>
								<a href="/photo/${trollItem.id}" target="_blank"> <c:choose>
										<c:when test="${trollItem.sexy == 'Y'}">
											<img src="/resources/images/nhaycam.jpg"
												alt="${trollItem.title}" class="thumbImg">
										</c:when>
										<c:otherwise>
											<img src="/resources/data/photos/${trollItem.url}"
												alt="${trollItem.title}" class="thumbImg">
										</c:otherwise>
									</c:choose>
								</a>
							</div>
							<c:if test="${trollItem.url.lastIndexOf('.gif') != -1}">
								<div class="trollThumbnail gif-post">
									<c:choose>
										<c:when test="${trollItem.sexy == 'Y'}">
											<img class="thumbImg badge-item-img"
												src="/resources/images/nhaycam.jpg">
										</c:when>
										<c:otherwise>
											<img class="thumbImg badge-item-img"
												src="/resources/data/photos/${trollItem.url.replace('.gif','.jpg')}">
										</c:otherwise>
									</c:choose>
									<span class="play-gif">GIF</span>
								</div>
							</c:if>
							<div class="info" style="position: relative;">
								<h2>
									<a target="_blank" href="/photo/${trollItem.id}">${trollItem.title}</a>
								</h2>
								<div class="uploader">
									Đăng bởi <a href="/uploader/${trollItem.uploader.id}">${trollItem.uploader.name}</a>
								</div>
								<p class="buttonSet">
									<button onclick="approve(${trollItem.id})" class="btn btn-primary buttons submitButton" type="submit">Approve</button>
									<button onclick="denied(${trollItem.id})" class="btn btn-primary buttons submitButton" type="submit">Denied</button>
								</p>
							</div>
					</div>
					</c:forEach>
				</div>
				<div id="loader" class="loader">
					<span></span> <span></span> <span></span> Loading...
				</div>

			</div>
			</div>
		</tiles:putAttribute>
	</tiles:insertDefinition>
</body>
</html>